//
//  MYShopSalesOrderBasePayView.swift
//  MuYing
//
//  Created by tbb on 2019/7/31.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYShopSalesOrderBasePayView: UIView {
    
    lazy var cancelBtn: UIButton = {
        let cancelBtn = UIButton(type: .custom);
        cancelBtn.setImage(UIImage(named: "ShopSalesOrder_cance_icon"), for: .normal);
        return cancelBtn;
    }()
    
    lazy var titleLb: UILabel = {
        let titleLb = UILabel();
        titleLb.textColor = appMainTitleColor;//UIColorFromHex(rgbValue: 0x);
        titleLb.font = UIFont.systemFont(ofSize: 17.0, weight: .regular);
        titleLb.textAlignment = .center;
        titleLb.text = "---";
        return titleLb;
    }()
    
    lazy var topLineView: UIView = {
        let lineView = UIView();
        lineView.backgroundColor = UIColorFromHex(rgbValue: 0xF3F3F3);
        return lineView;
    }()
    
    lazy var confirmBtn: UIButton = {
        let confirmBtn = UIButton(type: .custom);
        confirmBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium);
        confirmBtn.setTitleColor(.white, for: .normal);
        confirmBtn.backgroundColor = UIColorFromHex(rgbValue: 0xF88282);
        confirmBtn.setTitle("---", for: .normal);
        confirmBtn.layer.cornerRadius = 16.0;
        confirmBtn.clipsToBounds = true;
        return confirmBtn;
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame);
        self.backgroundColor = .white;
        UIView.roundedSetView(self, cornerRadius: 12, type: kRoundedSetViewType.roundedSetViewTypeTRL);
        
        self.backgroundColor = .white;
        self.addSubview(self.cancelBtn);
        self.cancelBtn.mas_makeConstraints { (make) in
            make?.left.mas_equalTo()(20);
            make?.top.mas_equalTo()(9);
            make?.size.mas_equalTo()(CGSize(width: 22, height: 22));
        }
        
        self.addSubview(self.titleLb);
        self.titleLb.mas_makeConstraints { (make) in
            make?.top.mas_equalTo()(8);
            make?.centerX.mas_equalTo()(0);
            make?.height.mas_equalTo()(24);
        };
        
        self.addSubview(self.topLineView);
        self.topLineView.mas_makeConstraints { (make) in
            make?.top.mas_equalTo()(43);
            make?.left.mas_equalTo()(0);
            make?.right.mas_equalTo()(0);
            make?.height.mas_equalTo()(1);
        }
        
        self.addSubview(self.confirmBtn);
        self.confirmBtn.mas_makeConstraints { (make) in
            make?.left.mas_equalTo()(12);
            make?.right.mas_equalTo()(-12);
            make?.bottom.mas_equalTo()(-32);
            make?.height.mas_equalTo()(32);
        }
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews();
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

